const express = require('express');
const app = express();
app.listen(9000, () => {
  console.log('服务器9000启动成功');
});

// 访问地址 http://localhost:9000/router_chained (请求方法改变查看结果)
app.route('/router_chained')
  .get((req, res) => {
    console.log('客户端发送GET请求');
    res.end();
  })
  .post((req, res) => {
    console.log('客户端发送POST请求');
    res.end();
  })
  .put((req, res) => {
    console.log('客户端发送PUT请求');
    res.end();
  });